home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / airfox.swf / scripts / frame_8 / PlaceObject2_342_160 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Encoding:
Text File  |  2006-06-13  |  1.5 KB  |  56 lines

  1. onClipEvent(load){
  2.    if(_name != "trainengine")
  3.    {
  4.       direction = random(2);
  5.       if(direction == 0)
  6.       {
  7.          placex = -200 + random(200);
  8.          placey = -60;
  9.          _X = placex;
  10.          _Y = placey;
  11.          maketrain = random(3);
  12.          t = 950;
  13.          while(maketrain + 951 >= t)
  14.          {
  15.             placex -= 20;
  16.             duplicateMovieClip(_root.traincar,"train" + t,16384 + t);
  17.             setProperty("_root.train" + t, _X, placex);
  18.             setProperty("_root.train" + t, _Y, placey);
  19.             tellTarget("_root.train" + t)
  20.             {
  21.                direction = 0;
  22.                _rotation = 0;
  23.             }
  24.             t++;
  25.          }
  26.          _root.track._y = placey;
  27.          _root.track._x = -20;
  28.       }
  29.       else
  30.       {
  31.          placex = 300 + random(200);
  32.          placey = -60;
  33.          _X = placex;
  34.          _Y = placey;
  35.          _rotation = 180;
  36.          maketrain = random(3);
  37.          t = 950;
  38.          while(maketrain + 951 >= t)
  39.          {
  40.             placex += 20;
  41.             duplicateMovieClip(_root.traincar,"train" + t,16384 + t);
  42.             setProperty("_root.train" + t, _X, placex);
  43.             setProperty("_root.train" + t, _Y, placey);
  44.             tellTarget("_root.train" + t)
  45.             {
  46.                direction = 1;
  47.                _rotation = 180;
  48.             }
  49.             t++;
  50.          }
  51.          _root.track._y = placey;
  52.          _root.track._x = -20;
  53.       }
  54.    }
  55. }
  56.